package com.hzit.security.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 类名：
 * 作者：WF
 * 功能：用户类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "sys_user")
public class User {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private String id;
	private String usercode;
	private String username;
	private String password;

	public User(String usercode, String username, String password) {
		this.usercode = usercode;
		this.username = username;
		this.password = password;
	}

	public static void main(String[] args) {
		BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
		String encode = encoder.encode("123");
		System.out.println("encode = " + encode);

	}
}
